{extend name="index/index"/}

{block name="body"}
<script type="text/javascript">
    $(document).ready(function () {
        var display_row = function () {
            var type = $('input[name=type]:checked').val();
            $('.reply-text,.reply-news,.reply-image').hide().find("textarea,select,input").removeAttr("required");
            $('.reply-' + type).show().find("textarea,select,input:text,input:hidden").attr("required", 'required');
        }
        setInterval(function () {
            display_row()
        }, 10);
        $('input[name=type]').on('change blur', display_row);
    });

    $(document).ready(common_obj.form_submit);

</script>

<header class="tab-head">
    <ul class="nav nav-tabs">
        <li class="">
            <a href="{:url('Wechat/url')}">系统链接列表</a>
        </li>

        <li class="active">
            <a href="{:url('Wechat/urladd')}">添加系统链接</a>
        </li>
    </ul>
</header>

<section class="wrapper" style="margin-top:0">
    <div class="row">
        <div class="col-lg-12">
            <section class="panel">
                <div class="panel-body">
                    <div class="form">
                        <form class="cmxform form-horizontal tasi-form" id="data-form">

                            <div class="form-group">
                                <label class="control-label col-lg-2">名称</label>
                                <div class="col-lg-10">
                                    <input class="form-control" type="text" name="name" required="required" value="{$data.name}"/>
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="control-label col-lg-2">链接</label>
                                <div class="col-lg-10">
                                    <input class="form-control" type="text" name="url" required="required" value="{$data.url}"/>
                                </div>
                            </div>

                            <div class="form-group">
                                <div class="col-lg-offset-2 col-lg-10">
                                    <input class="btn btn-danger" type="submit" value="提交保存">

                                </div>
                            </div>

                            <input type="hidden" name="id" value="{$data.id}">
                        </form>
                        <input type="hidden" id="do_action" value="{:url('Wechat/urladd')}"/>
                    </div>
                </div>
            </section>
        </div>
    </div>
</section>
{/block}